﻿var currentDeptID;
$(document).ready(
function () {
    $("#myDataTable").treeTable({
        treeColumn: -1,
        key: 'ID',
        onSelected: function (node) {
            currentDeptID = $("#myDataTable").ttKey();
        },
        bind: {
            templateID: '#ArticleList',
            url: "GetArticleList",
            ajaxPara: null,
            ajaxLoad: true,
            ajaxError: function (e) {
                ErrorInfo(e);
            }
        }
    });
});
function deletes(id) {
    $.ajax({
        url: "deleteArticle",
        data: { "id": id },
        success: function (data) {
            if (data) {
                $("#myDataTable").ttGetItem(currentDeptID).ttRemove();
                alert("删除成功");
                return;
            }
        },
        error: function () {
        }
    });
}